package com.zyl.blog.common.domain.rbac.enums;

import lombok.Getter;

/**
 * @version v1.0
 * @ProjectName: Personal_Blog
 * @Package: com.zyl.common.domain.rbac.enums
 * @ClassName: LoginTagEnum
 * @Description:
 * @Author FinalFantasy
 * @Date 2025/6/24-15:36
 */
@Getter
public enum AuthType {

    USERNAME("username", "用户名认证"),
    EMAIL("email", "邮箱认证"),
    PHONE("phone", "手机号认证"),
    WECHAT("wechat", "微信认证"),
    QQ("qq", "QQ认证");

    private final String tag;
    private final String description;

    AuthType(String tag, String description) {
        this.tag = tag;
        this.description = description;
    }

    public static AuthType of(String tag) {
        for (AuthType type : values()) {
            if (type.getTag().equals(tag)) {
                return type;
            }
        }
        throw new IllegalArgumentException("未知的认证类型: " + tag);
    }
}
